#!/usr/bin/env python 
# -*- coding:utf-8 -*-

import pandas as pd
import numpy as np

#导入csv文件
# df = pd.DataFrame(pd.read_csv('data.csv', header=1))
# df2 = pd.DataFrame(pd.read_excel('data.xls'))
#创建数据表
df3 = pd.DataFrame(
    {"id": [1,2,3],
    "date": pd.date_range('20230103',periods=3),
    "city": ["beijing", "shanghai", "chongqing"],
    "price": [100, np.nan, 200]},
    columns=['id', 'date', 'city', 'price']
)
print(df3)
# print(df3.index)
# print(df3.values)
df3.id = [6,7,8]

for items in df3.index:
    print(df3.values[items])

# print(df3['id'])
# =
# print(df3.id)

# df3.to_csv('test111.csv',index= False)

#查看维度（几行几列）
# print(df.shape)
# print(df.info())

#查看列名
# print(df.columns.values)
# print(len(df.values))
# print(df.index)